package com.steel.yfmall.cloud.assistant.stock.impl;

import com.steel.yfmall.cloud.assistant.stock.SteelChannelDepotSkuBeanService;
import com.steel.yfmall.cloud.assistant.stock.mapper.SteelChannelDepotSkuBeanOtherMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author jia chang bao
 * @date 2021/2/23 11:28
 */
@Service
@Slf4j
public class SteelChannelDepotSkuBeanServiceImpl implements SteelChannelDepotSkuBeanService {
    /**
     * 修改 库存表 将最后一次同步库存值 改为 冻结数量
     *
     * @return true 成功  ， false 失败
     */
    @Override
    public Boolean updateSteelChannelDepotSkuLastSyncStock(List<String> productSysCode) {
        int i = steelChannelDepotSkuBeanOtherMapper.updateLastSyncStock(productSysCode);
        if (i > 0) {
            return true;
        }
        return false;
    }

    /**
     * 修改 限购库存量 为 0
     *
     * @return true 成功  ， false 失败
     */
    @Override
    public Boolean updateSteelChannelDepotSkuLockLimitStock(List<String> productSysCode) {
        int i = steelChannelDepotSkuBeanOtherMapper.updateLockLimitStock( productSysCode);
        if (i > 0) {
            return true;
        }
        return false;
    }

    @Resource
    private SteelChannelDepotSkuBeanOtherMapper steelChannelDepotSkuBeanOtherMapper;

}
